#ifndef  _DATABASE_H_
#define  _DATABASE_H_

#include "packet.h"

#define SQL_COMMAND_LEN        256

int select_table(void);

/* Description: Open or create sqlite database if not exist. */
int db_create(char *filename);

/* Description: Close sqlite database handler */
int db_close(void);

/* Description: Push/Save packet data in database */
int db_insert(packet_t *pack);

/* Description: Pop/Get first record(packet data) from database */
int db_firstdata(packet_t *pack);

/* Description: Remove first record(packet data) from database */
int db_delete(void);

#endif   /* ----- #ifndef _DATABASE_H_  ----- */
